package com.xqboss.common.core.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * 分页数据
 * @param <T>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageList<T> implements Serializable
{
    private static final long serialVersionUID = 1L;

    private List<T> list;

    private long total;

    public static <T> PageList<T> of(List<T> list, long total) {
        PageList<T> apiResult = new PageList<>();
        apiResult.setList(list);
        apiResult.setTotal(total);
        return apiResult;
    }
}

